const Base = require('../../base.js');
module.exports = class extends Base {
  async __before() {
    this.key = "78064bdd42132778237adca804565ff3"
  }
  // 关键词搜索地址
  async getdzxqAction(){
    if(!this.get("text")){
      return this.success("")
    }
    const {pois} = await this.dxGet("https://restapi.amap.com/v3/place/text",{
      key:this.key,
      keywords:this.get("text")
    })
    let lissd = []
    pois.map(a=>{
      lissd.push({
        dz:a.pname+a.cityname+a.adname+a.address,
        location:a.location
      })
    })
    this.success(lissd)
  }
}